﻿@using NGM.Forum.Models
@using Orchard.ContentManagement
@using Orchard.Utility.Extensions
@{
    IEnumerable<object> posts = Model.ContentItems;
    ThreadPart contentPart = Model.ContentPart;
    Model.ContentItems.Classes.Add("content-items");
    var contentTypeClassName = ((string)contentPart.ContentItem.ContentType + "-posts").HtmlClassify();
    Model.ContentItems.Classes.Add(contentTypeClassName);
    
    bool noReplies = posts.Count() == 1 && (((ContentItem) ((dynamic) posts.First()).ContentItem).As<PostPart>().IsParentThread());
}
@Display(Model.ContentItems)
@if (noReplies) {
    <p class="nocontentitems">@T("There are no replies to this post.")</p>
} else { 
  @Display(Model.Pager)
}